package com.gadarts.parashoot.weapons;


import android.graphics.Bitmap;

import com.gadarts.parashoot.GameModel;
import com.gadarts.parashoot.GameObject;
import com.gadarts.parashoot.GameView;
import com.gadarts.parashoot.Sprite;

public abstract class Bullet extends GameObject {

	//private boolean myBullet;//Whether this bullet is the player's or not.

	public Bullet(GameModel model, GameView view, Sprite sprite, int x, int y, int speed, int direction, boolean myBullet, int depth) {
		super(model, view, sprite, x, y, speed, direction, depth, true);
		super.child = this;
		//this.myBullet = myBullet;
		pivotX = (int)(Math.cos(Math.toRadians(direction)) * (-getWidth()/2));
		pivotY = (int)(Math.sin(Math.toRadians(direction)) * (-getHeight()/2));
		setDirection(direction);
	}
	public Bullet(GameModel model, GameView view, Sprite sprite, int x, int y, int speed, int direction, int depth) {
		super(model, view, sprite, x, y, speed, direction, depth, true);
		super.child = this;
		//this.myBullet = myBullet;
		pivotX = (int)(Math.cos(Math.toRadians(direction)) * (-getWidth()/2));
		pivotY = (int)(Math.sin(Math.toRadians(direction)) * (-getHeight()/2));
		setDirection(direction);
	}
	public Bullet(GameModel model, GameView view, Bitmap image, int x, int y,
			int speed, int direction, boolean myBullet, int depth) {
		super(model, view, image, x, y, speed, direction, depth, true);
		super.child = this;
		//this.myBullet = myBullet;
		pivotX = (int)(Math.cos(Math.toRadians(direction)) * (-getWidth()/2));
		pivotY = (int)(Math.sin(Math.toRadians(direction)) * (-getHeight()/2));
		setDirection(direction);
	}
}
